package com.demo.rocketmq.task;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;

import java.util.concurrent.Callable;

/**
 * @author wangfengchen
 * 可以从构造方法传入userService
 */
@Slf4j
@RequiredArgsConstructor
public class DemoTask implements Callable<Boolean> {

    private final String requestId;
    private final String key;
    private final String msg;


    @Override
    public Boolean call() throws Exception {
        log.info("requestId = {}，异步任务处理消息，key = {}，msg = {}", requestId, key, msg);
        // TODO 处理业务逻辑
//            UserEntity user = userService.getById(1);
//            log.info("执行业务逻辑，user = {}", JSON.toJSONString(user, SerializerFeature.WriteDateUseDateFormat));
        return true;
    }




}
